﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace JiveMessenger.Models
{
    public enum JiveStatusGroupStatus
    {
        Online,
        Offline
    }
    public class JiveClientStatusGroupModel : IChatGroup
    {
        public string ID { get; private set; }
        private JiveStatusGroupStatus _status;
        public JiveStatusGroupStatus Status
        {
            get { return _status; }
            set
            {
                if (_status != value)
                {
                    _status = value;
                    RaisePropertyChanged("Status");
                }
            }
        }
        
        private string _name;
        public string Name
        {
            get { return _name; }
            set
            {
                if (_name != value)
                {
                    _name = value;
                    RaisePropertyChanged("Name");
                }
            }
        }


        private bool _isExpanded;
        public bool IsExpanded
        {
            get { return _isExpanded; }
            set
            {
                if (_isExpanded != value)
                {
                    _isExpanded = value;
                    RaisePropertyChanged("IsExpanded");
                }
            }
        }

        public GroupType Type
        {
            get { return GroupType.JiveContactStatusGroup; }
        }

        public JiveClientStatusGroupModel(string id,JiveStatusGroupStatus status)
        {
            this.ID = id;
          //  this.ID = Guid.NewGuid().ToString();
            this.Status = status;
            switch (this.Status)
            {
                case JiveStatusGroupStatus.Offline:
                    this.Name = "Offline";
                    break;
                case JiveStatusGroupStatus.Online:
                    this.Name = "Online";
                    break;
            }
        }
        protected virtual void RaisePropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
        }
        public event PropertyChangedEventHandler PropertyChanged;

    }
}
